API Documentation
Public Member Functions | List of all members
nkGraphics::EntityRenderLodSlot Class Referencefinal

A LOD slot to potentially draw, within a group slot. More...

Inheritance diagram for nkGraphics::EntityRenderLodSlot:
nkExport::Exportable

Public Member Functions

 EntityRenderLodSlot ()
 
 EntityRenderLodSlot (Mesh *mesh, Shader *shader)
 
 ~EntityRenderLodSlot ()
 
const BoundingBoxgetBounds () const
 
MeshgetMesh () const
 
ShadergetShader () const
 
ShadergetRaytracingShader () const
 
float getQualityMetric () const
 
ShadergetActiveShader () const
 
EntityRenderInfoSlotgetParentSlot () const
 
EntitygetParentEntity () const
 
void setMesh (Mesh *value)
 
void setShader (Shader *value)
 
void setRaytracingShader (Shader *value)
 
void setQualityMetric (float value)
 
void setDirtyNodeTransform (bool value)
 
void meshBoundsUpdated ()
 
void meshLayoutUpdated ()
 
bool isCompatibleWith (Shader *shade) const
 
void updateBasicShader ()
 
virtual void exportClassToTree (nkExport::Node *rootNode) override
 
virtual void importClassFromTree (nkExport::Node *rootNode) override
 
- Public Member Functions inherited from nkExport::Exportable
 Exportable ()
 
virtual ~Exportable ()
 

Detailed Description

A LOD slot to potentially draw, within a group slot.

This represents the end point in the rendering information, linking a mesh to a shader. The default render strategy will select one LOD to render, using provided information.

Constructor & Destructor Documentation

◆ EntityRenderLodSlot() [1/2]

nkGraphics::EntityRenderLodSlot::EntityRenderLodSlot ( )

Default constructor.

◆ EntityRenderLodSlot() [2/2]

nkGraphics::EntityRenderLodSlot::EntityRenderLodSlot ( Mesh mesh,
Shader shader 
)

Legacy convenience constructor.

Parameters
meshThe mesh to use.
shaderThe shader to use.

◆ ~EntityRenderLodSlot()

nkGraphics::EntityRenderLodSlot::~EntityRenderLodSlot ( )

Destructor.

Member Function Documentation

◆ getBounds()

const BoundingBox& nkGraphics::EntityRenderLodSlot::getBounds ( ) const
Returns
The LOD's bounds, mix between the mesh itself and the node attached to the parent entity, if any.

◆ getMesh()

Mesh* nkGraphics::EntityRenderLodSlot::getMesh ( ) const
Returns
The mesh attached.

◆ getShader()

Shader* nkGraphics::EntityRenderLodSlot::getShader ( ) const
Returns
The shader wanted, when used in a RenderScenePass.
Remarks
This is the wanted shader for the LOD, which will be used or not depending on its compatibility with given mesh.

◆ getRaytracingShader()

Shader* nkGraphics::EntityRenderLodSlot::getRaytracingShader ( ) const
Returns
The raytracing shader used, when in a raytraced queue used in a RaytracingPass.

◆ getQualityMetric()

float nkGraphics::EntityRenderLodSlot::getQualityMetric ( ) const
Returns
The set quality metric.

◆ getActiveShader()

Shader* nkGraphics::EntityRenderLodSlot::getActiveShader ( ) const
Returns
The shader used, when used in a RenderScenePass.
Remarks
This is the shader marked as active, which will actually be used during rendering. Depending on the compatibility between the wanted shader and the mesh attached, this will return either the wanted shader (if compatible), or one of the component's compatible built-in shaders.

◆ getParentSlot()

EntityRenderInfoSlot* nkGraphics::EntityRenderLodSlot::getParentSlot ( ) const
Returns
The parent slot.

◆ getParentEntity()

Entity* nkGraphics::EntityRenderLodSlot::getParentEntity ( ) const
Returns
The parent entity.

◆ setMesh()

void nkGraphics::EntityRenderLodSlot::setMesh ( Mesh value)

Sets the mesh to use during rendering.

Parameters
valueThe mesh to use.

◆ setShader()

void nkGraphics::EntityRenderLodSlot::setShader ( Shader value)

Sets the shader to use during a RenderScenePass. This shader will be used, or not, depending on its compatibility with linked mesh.

Parameters
valueThe shader to use.

◆ setRaytracingShader()

void nkGraphics::EntityRenderLodSlot::setRaytracingShader ( Shader value)

Sets the shader to use during a RaytracingPass.

Parameters
valueThe shader to use.

◆ setQualityMetric()

void nkGraphics::EntityRenderLodSlot::setQualityMetric ( float  value)

Sets the quality metric which can be used for LOD selection. This number can represent anything, but needs a meaning that can be interpreted by the RenderStrategy which will use it. For an exemple of how this could be interpreted, check the DefaultRenderStrategy.

Parameters
valueThe value to provide.

◆ setDirtyNodeTransform()

void nkGraphics::EntityRenderLodSlot::setDirtyNodeTransform ( bool  value)

Sets the transformation dirty flag. Used internally.

◆ meshBoundsUpdated()

void nkGraphics::EntityRenderLodSlot::meshBoundsUpdated ( )

Notifies that the bounds have been udpated. Used internally.

◆ meshLayoutUpdated()

void nkGraphics::EntityRenderLodSlot::meshLayoutUpdated ( )

Notifies that the mesh's layout has been updated. Used internally.

◆ isCompatibleWith()

bool nkGraphics::EntityRenderLodSlot::isCompatibleWith ( Shader shade) const
Parameters
shadeThe shader to test against.
Returns
Whether the LOD, given its current state (its mesh currently), is compatible with the provided shader.

◆ updateBasicShader()

void nkGraphics::EntityRenderLodSlot::updateBasicShader ( )

Updates the basic shader used by the LOD, based on the active mesh. The basic shader refers to the best built-in shaders that can be used within the component.

◆ exportClassToTree()

virtual void nkGraphics::EntityRenderLodSlot::exportClassToTree ( nkExport::Node rootNode)
overridevirtual

Basic exporting capabilities.

Parameters
rootNodeThe tree to export to.

Implements nkExport::Exportable.

◆ importClassFromTree()

virtual void nkGraphics::EntityRenderLodSlot::importClassFromTree ( nkExport::Node rootNode)
overridevirtual

Basic importing capabilities.

Parameters
rootNodeThe tree to import from.

Implements nkExport::Exportable.


The documentation for this class was generated from the following file: